package com.earl.eatbao.dao.eatbao;

import java.util.List;

import com.earl.eatbao.commons.dao.BaseRepsitoty;
import com.earl.eatbao.domain.eatbao.Address;

public interface AddressDao extends BaseRepsitoty<Address,Long>{

	Address findUniqueByCreatedByAndIsDefaultTrue(long userId);


	List<Address> findByCreatedBy(Long userId);

	/**
	 * 查询用户使用的地址
	 * @param userId
	 * @return
	 */
	List<Address> findByUserId(Long userId);

	/**
	 * 适应软删除,只展示未删除数据
	 * @param userId
	 * @return
	 */
	List<Address> findByCreatedByAndIsDeleteFalse(String userId);

	/**
	 * 查找用户所有地址
	 * @param userId
	 * @return
	 */
	List<Address> findByUserIdAndIsDeleteFalse(Long userId);

	
	Address findUniqueByCreatedByAndIsDefaultTrueAndIsDeleteFalse(String userId);


	/**
	 * 查询用户默认地址
	 * @param userId
	 * @return
	 */
	Address findUniqueByUserIdAndIsDefaultTrueAndIsDeleteFalse(Long  userId);
}
